﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using RequestEchoNest.ViewModel;

namespace RequestEchoNest
{


    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : Window
    {

        private MainViewModel _mainViewModel;

        public MainView()
        {
            InitializeComponent();
            _mainViewModel =new MainViewModel();;
            LayoutRoot.DataContext = _mainViewModel;
            SettingsTab.DataContext = new SettingsTabViewModel();
        }

        private void tabItemGetSimialrArtists_FocusableChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            textBoxArtistName.Focus();
        }

        private void textBoxArtistName_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                _mainViewModel.GetSimilars(textBoxArtistName.Text);
            }
        }

        private void uploadTrackButton_Click(object sender, RoutedEventArgs e)
        {
            _mainViewModel.GetSimilarTracks(uploadTrackNameTextBox.Text);
        }
    }
}
